# coding: utf-8
from enum import Enum

from qfluentwidgets import FluentIconBase, getIconColor, Theme
from .setting import RESOURCES_DIR


class Icon(FluentIconBase, Enum):
    GRID = "Grid"
    MENU = "Menu"
    TEXT = "Text"
    PRICE = "Price"
    EMOJI_TAB_SYMBOLS = "EmojiTabSymbols"
    LIST = 'List'
    TWO_GRID = 'TwoGrid'
    CLOSE = 'close'
    MAX1 = 'Max1'
    MAX2 = 'Max2'
    MIN = 'Min'
    TOP = 'Top'
    STAR = 'Star'
    OPEN_FOLDER = 'OpenFolder'
    SPEED_0_5 = 'Speed-0.5'
    SPEED_0_75 = 'Speed-0.75'
    SPEED_1_0 = 'Speed-1.0'
    SPEED_1_25 = 'Speed-1.25'
    SPEED_1_5 = 'Speed-1.5'
    SPEED_1_75 = 'Speed-1.75'
    SPEED_2_0 = 'Speed-2.0'
    OPEN_FILE = 'OpenFile'

    def path(self, theme=Theme.AUTO):
        path = RESOURCES_DIR / f"images/icons/{self.value}_{getIconColor(theme)}.svg"
        return path.as_posix()


class SingleIcon(FluentIconBase, Enum):
    LOGO = 'logo.png'
    BANANA = 'banana.png'
    BANANA_MIN = 'banana_min.png'
    BACKGROUND = 'background.png'
    NODATA = 'nodata.svg'

    def path(self, theme=Theme.AUTO) -> str:
        path = RESOURCES_DIR / f'images/single/{self.value}'
        return path.as_posix()
